package com.niiwoo.civet.account.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 换绑卡类型枚举
 * @author TomXue
 * @since 2018-07-30
 */
@AllArgsConstructor
@Getter
public enum BankCardRebindTypeEnum {
    PERSON((byte) 1, "对私帐户换卡"),
    COMPANY((byte) 2, "对公帐户换卡");

    private Byte type;
    private String desc;

    public static BankCardRebindTypeEnum enumOf(Byte value) {
        for (BankCardRebindTypeEnum type : values()) {
            if (type.type.equals(value)) {
                return type;
            }
        }
        throw new NoSuchEnumValueException("BankCardRebindTypeEnum:" + value);
    }

}
